extends Resource
class_name GetRid

func _init() -> void :
	generate_uuid_like()

func generate_uuid_like() -> String:
	var rng = RandomNumberGenerator.new()
	rng.randomize()
	
	var hex_chars = "0123456789abcdef"
	var result = ""
	
	# 生成8-4-4-4-12格式的UUID
	var pattern = [8, 4, 4, 4, 12]
	
	for i in range(pattern.size()):
		if i > 0:
			result += "-"
		for j in range(pattern[i]):
			var random_index = rng.randi() % hex_chars.length()
			result += hex_chars[random_index]
	return result
